﻿using System;

using Hammock.Web;

namespace TMWS
{
	using Models;

	/// <summary>
	/// Manialink service
	/// </summary>
	public class ManialinkService : ServiceBase
	{
		#region Constructor

		/// <summary>
		/// Initializes a new instance of the <see cref="ManialinkService"/>
		/// </summary>
		/// <param name="username">API username</param>
		/// <param name="password">API password</param>
		public ManialinkService(string username, string password)
			: base(username, password)
		{
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="ManialinkService"/>
		/// </summary>
		/// <param name="username">API username</param>
		/// <param name="password">APU password</param>
		/// <param name="enableLogging">Enable logging</param>
		/// <param name="logDirectory">Directory to store logs</param>
		public ManialinkService(string username, string password, bool enableLogging, string logDirectory)
			: base(username, password, enableLogging, logDirectory)
		{
		}

		#endregion

		#region Public Methods

		/// <summary>
		/// Gets information about the specified manialink
		/// </summary>
		/// <param name="manialink">Manialink name</param>
		/// <returns>Manialink information</returns>
		public ManiaLink GetManialinkInformation(string manialink)
		{
			string resource = String.Format("tmf/manialinks/{0}/", manialink);

			return Execute<ManiaLink>(resource, WebMethod.Get);
		}

		#endregion
	}
}